#[derive(Debug)]
enum IpAddrKind {
    IPV4,
    IPV6,
}
enum IpAddr {
        IPV4(u8,u8,u8,u8),
        IPV6(String),
    }

struct IpAddress {
    kind: IpAddrKind,
    address: IpAddr,
}
// 根据传入的IpAddrKind参数，执行相应的路由操作
fn route(ip_kind: IpAddrKind) {
    // ...
}

fn main() {
    // 定义一个IP地址类型
    let four = IpAddrKind::IPV4;
    let six = IpAddrKind::IPV6;

    let home = IpAddress {
        kind: IpAddrKind::IPV4,
        address: IpAddr::IPV4(127,0,0,1),
    };

    let loopback = IpAddress {
        kind: IpAddrKind::IPV6,
        address: IpAddr::IPV6(String::from("::1")),
    };
}
